package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.OrgDeptMapper;
import com.ruoyi.system.domain.OrgDept;
import com.ruoyi.system.service.IOrgDeptService;
import com.ruoyi.common.core.text.Convert;

/**
 * yonbip部门Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-05
 */
@Service
public class OrgDeptServiceImpl implements IOrgDeptService 
{
    @Autowired
    private OrgDeptMapper orgDeptMapper;

    /**
     * 查询yonbip部门
     * 
     * @param pkDept yonbip部门主键
     * @return yonbip部门
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public OrgDept selectOrgDeptByPkDept(String pkDept)
    {
        return orgDeptMapper.selectOrgDeptByPkDept(pkDept);
    }

    /**
     * 查询yonbip部门列表
     * 
     * @param orgDept yonbip部门
     * @return yonbip部门
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<OrgDept> selectOrgDeptList(OrgDept orgDept)
    {
        return orgDeptMapper.selectOrgDeptList(orgDept);
    }

    /**
     * 新增yonbip部门
     * 
     * @param orgDept yonbip部门
     * @return 结果
     */
    @Override
    public int insertOrgDept(OrgDept orgDept)
    {
        return orgDeptMapper.insertOrgDept(orgDept);
    }

    /**
     * 修改yonbip部门
     * 
     * @param orgDept yonbip部门
     * @return 结果
     */
    @Override
    public int updateOrgDept(OrgDept orgDept)
    {
        return orgDeptMapper.updateOrgDept(orgDept);
    }

    /**
     * 批量删除yonbip部门
     * 
     * @param pkDepts 需要删除的yonbip部门主键
     * @return 结果
     */
    @Override
    public int deleteOrgDeptByPkDepts(String pkDepts)
    {
        return orgDeptMapper.deleteOrgDeptByPkDepts(Convert.toStrArray(pkDepts));
    }

    /**
     * 删除yonbip部门信息
     * 
     * @param pkDept yonbip部门主键
     * @return 结果
     */
    @Override
    public int deleteOrgDeptByPkDept(String pkDept)
    {
        return orgDeptMapper.deleteOrgDeptByPkDept(pkDept);
    }
}
